package com.sushuo.api.config;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ConfigTest {
    
    @Value("test.config")    
    private String testConfig; // testConfig = "test.config";
    
    @Value("${test.config.static}")    
    private String testStaticInnerConfig; // testStaticInnerConfig = 配置文件中 test.config.static 等号后面的值
    
    public static String staticConfig;
    
    /**
     * 间接给类静态成员初始化的方法
     * http://www.jianshu.com/p/127310cb90e0
     */
    @PostConstruct
    public void init() {
        staticConfig = testStaticInnerConfig;
    }
}
